import React, { useState, useEffect } from 'react';
import Box from './box';
import Text from './text';
import Circle from './circle';

function getComponents(item){
  switch(item.component){
    case 'r-box':
      return (
        <Box data={item} />
      )
    case 'r-text':
      return (
        <Text data={item} />
      )
    case 'r-circle':
      return (
        <Circle data={item} />
      )
    default: break;
  }
}
export default ({data}) => {
  return (
    getComponents(data)
  );
}

